package com.rc.evcharger.common.type;

import java.lang.reflect.Field;
import java.math.BigDecimal;

/**
 * (CMD=36) 桩充电功率限制指令（平台发送）
 */
public class ElecPileLimitPowerData extends BaseType implements DataType {

    String maxPower;//桩最大功率上限值

    String obligate = "00 00 00 00";
    //BCD 码单
    //位：秒.当
    //该字段值
    //为 0 时，
    //表示仅上
    //报一次


    public String getMaxPower() {
        return maxPower;
    }

    public void setMaxPower(BigDecimal maxPower) {
        maxPower = maxPower.multiply(new BigDecimal(10));
        //value=value.setScale(bl.decimal(), BigDecimal.ROUND_DOWN);
        String str = String.valueOf(String.format("%04x", maxPower.intValue())).toUpperCase();
        this.maxPower = str.substring(2, 4) + " " + str.substring(0, 2);
    }

    public String getObligate() {
        return obligate;
    }

    public void setObligate(String obligate) {
        this.obligate = obligate;
    }

    @Override
    public boolean customField(Field field, StringBuffer sb) {
        return false;
    }

}
